package com.dldata.display.entity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
 * Created by 倪继文 on 2017/5/10.
 */
@Entity
@Table(name = "members")
public class MembersEntity {
    private String id;
    private String name;
    private BigDecimal age;
    private String adress;
    private Timestamp brithdate;
    private String cellPhone;
    private String zy;
    private String ah;
    private String xl;
    private String templateid;
    private String tableid;

    @Id
    @Column(name = "id", nullable = false, length = 50)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "name", nullable = true, length = 50)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "age", nullable = true, precision = 2)
    public BigDecimal getAge() {
        return age;
    }

    public void setAge(BigDecimal age) {
        this.age = age;
    }

    @Basic
    @Column(name = "adress", nullable = true, length = 255)
    public String getAdress() {
        return adress;
    }

    public void setAdress(String adress) {
        this.adress = adress;
    }

    @Basic
    @Column(name = "brithdate", nullable = true)
    public Timestamp getBrithdate() {
        return brithdate;
    }

    public void setBrithdate(Timestamp brithdate) {
        this.brithdate = brithdate;
    }

    @Basic
    @Column(name = "cell_phone", nullable = true, length = 50)
    public String getCellPhone() {
        return cellPhone;
    }

    public void setCellPhone(String cellPhone) {
        this.cellPhone = cellPhone;
    }

    @Basic
    @Column(name = "zy", nullable = true, length = 255)
    public String getZy() {
        return zy;
    }

    public void setZy(String zy) {
        this.zy = zy;
    }

    @Basic
    @Column(name = "ah", nullable = true, length = 255)
    public String getAh() {
        return ah;
    }

    public void setAh(String ah) {
        this.ah = ah;
    }

    @Basic
    @Column(name = "xl", nullable = true, length = 255)
    public String getXl() {
        return xl;
    }

    public void setXl(String xl) {
        this.xl = xl;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MembersEntity that = (MembersEntity) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (age != null ? !age.equals(that.age) : that.age != null) return false;
        if (adress != null ? !adress.equals(that.adress) : that.adress != null) return false;
        if (brithdate != null ? !brithdate.equals(that.brithdate) : that.brithdate != null) return false;
        if (cellPhone != null ? !cellPhone.equals(that.cellPhone) : that.cellPhone != null) return false;
        if (zy != null ? !zy.equals(that.zy) : that.zy != null) return false;
        if (ah != null ? !ah.equals(that.ah) : that.ah != null) return false;
        if (xl != null ? !xl.equals(that.xl) : that.xl != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (age != null ? age.hashCode() : 0);
        result = 31 * result + (adress != null ? adress.hashCode() : 0);
        result = 31 * result + (brithdate != null ? brithdate.hashCode() : 0);
        result = 31 * result + (cellPhone != null ? cellPhone.hashCode() : 0);
        result = 31 * result + (zy != null ? zy.hashCode() : 0);
        result = 31 * result + (ah != null ? ah.hashCode() : 0);
        result = 31 * result + (xl != null ? xl.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "templateid", nullable = true, length = 255)
    public String getTemplateid() {
        return templateid;
    }

    public void setTemplateid(String templateid) {
        this.templateid = templateid;
    }

    @Basic
    @Column(name = "tableid", nullable = true, length = 255)
    public String getTableid() {
        return tableid;
    }

    public void setTableid(String tableid) {
        this.tableid = tableid;
    }
}
